/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2019-2022.
 * Description: support oom_exterd (show oom_slab_vmalloc) feature
 * Author: fanglinxu
 * Create: 2019-02-26
 */

#ifndef __MM_OOM_SLAB_VMALLOC_H
#define __MM_OOM_SLAB_VMALLOC_H

#include <linux/seq_file.h>

#ifdef CONFIG_RTOS_OOM_EXTEND
extern struct seq_file *seq_file_buf_init(void);
extern void seq_to_printk(const struct seq_file *m);
extern void oom_vmallocinfo_show(void);
#ifdef CONFIG_SLABINFO
extern void s_slabinfo(struct kmem_cache *s);
#else
#ifdef CONFIG_SLAB
static inline void s_slabinfo(struct kmem_cache *s)
{
}
#endif
#endif

extern struct list_head slab_caches;
extern struct mutex slab_mutex;
#endif

#if defined(CONFIG_RTOS_OOM_EXTEND) && defined(CONFIG_RTOS_VMALLOC_PRINT_DEBUGINFO)
void vmallocinfo_debug(unsigned long vstart);
#else
static inline void vmallocinfo_debug(unsigned long vstart) {}
#endif

#endif
